<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="embroot.css">
<TITLE>
Basic Concepts of the Interface
</TITLE>
</HEAD>
<BODY >
<A HREF="embroot026.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="embroot028.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc48">6.1</A>&nbsp;&nbsp;Basic Concepts of the Interface</H2>
The interface is used by starting separate ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> and Tcl processes, and
then <B>attaching</B> the Tcl process to the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> process. Once
attached, the Tcl and ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> processes can communicate much as in the
embedded interface: ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> goals can be sent from the Tcl side to the
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side via the remote predicate call (<B>ec_rpc</B>) mechanism, 
and further I/O queues can be established between the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> and Tcl
processes to allow streams of bytes to sent from one side to the other.<BR>
<BR>
The attached Tcl
process can also be detached from the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> process. This
disconnection will terminate and clean-up the links between the two
processes. Thus, typically, if the programmer wants to allow a particular
application to be usable through both the Tcl remote and embedding
interfaces, the only code that needs to be specific to one or the other
interface is the code associated with starting and termination of the
application (the attach and detach operations in the case of the remote
interface). <BR>
<BR>
The interaction between the Tcl and ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> is mediated by a version of
thread-like control flow of the embedded interface. The
interface distinguishes two `sides': the Tcl side, which is the Tcl
process, and the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side, which is generally the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>
process<SUP><A NAME="text4" HREF="embroot026.html#note4">1</A></SUP>. At any given time,
either the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side or the Tcl side has `control'. When the Tcl side
has control, execution of the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> process is suspended. When the
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side has control, the Tcl side cannot initiate the execution of
ec_rpc goals. The interface can implicitly transfer control from one side
to the other (e.g. when processing synchronous I/O), or it can be
explicitly transferred.<BR>
<BR>
An ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> process can have several attached remote processes. Each
remote process is identified by a <B>control</B> name, which is the
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> name for a special control connection between the two sides. <BR>
<BR>
<HR>
<A HREF="embroot026.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="embroot028.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
